import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);

export default new Router({
  // mode: "history",
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/',
      component: () => import('../components/common/Base.vue'),
      meta: {
        title: '公共部分'
      },
      children: [
        {
          path: '/index',
          component: () => import('../components/page/Home.vue'),
          meta: {
            title: '系统首页'
          }
        },
        {
          path: '/chart-simple',
          component: () => import('../components/page/EchartsSimple.vue'),
          meta: {
            title: '简单图表'
          }
        },
        {
          path: '/chart-complex',
          component: () => import('../components/page/EchartsComplex.vue'),
          meta: {
            title: '复杂图表'
          }
        },
        {
          path: '/customer',
          component: () => import('../components/page/Customer.vue'),
          meta: {
            title: '客户管理'
          }
        },
        // 用户管理
        {
          path: '/user',
          component: () => import('../components/page/User.vue'),
          meta: {
            title: '用户管理'
          }
        },
        {
          path: '/role',
          component: () => import('../components/page/Role.vue'),
          meta: {
            title: '角色管理'
          }
        },
        {
          path: '/resources',
          component: () => import('../components/page/Resources.vue'),
          meta: {
            title: '资源管理'
          }
        },
        {
          path: '/chance',
          component: () => import('../components/page/chance.vue'),
          meta: {
            title: '营销机会管理'
          }
        },
        {
          path: '/cus',
          component: () => import('../components/page/cus.vue'),
          meta: {
            title: '客户开发计划'
          }
        },
        // 服务管理
               
        {
          path: '/index1',
          component: () => import('../components/page/index1.vue'),
          meta: {
            title: '服务创建'
          }
        },
        {
          path: '/index2',
          component: () => import('../components/page/index2.vue'),
          meta: {
            title: '服务分配'
          }
        },
        {
          path: '/index3',
          component: () => import('../components/page/index3.vue'),
          meta: {
            title: '服务处理'
          }
        },
        {
          path: '/index4',
          component: () => import('../components/page/index4.vue'),
          meta: {
            title: '服务反馈'
          }
        },
        {
          path: '/index5',
          component: () => import('../components/page/index5.vue'),
          meta: {
            title: '服务归档'
          }
        },
        {
          path: '/tab',
          component: () => import('../components/page/Tab.vue'),
          meta: {
            title: 'tab选项卡'
          }
        },
        {
          path: '/table',
          component: () => import('../components/page/Table.vue'),
          meta: {
            title: '表格'
          }
        },
        {
          path:"/log",
          component:() => import('../components/page/Log.vue'),
          meta: {
            title: '操作日志'
          }
        },
      ]
    },
    {
      path: '/login',
      component: () => import('../components/page/LoginMy.vue')
    },
    {
      path: '/error',
      component: () => import('../components/page/Error.vue')
    },
    {
      path: '/404',
      component: () => import('../components/page/404.vue')
    }
  ]
})
